package com.example.service;

import com.example.dao.TeacherMapper1;
import com.example.domain.TeacherEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;

@Transactional(propagation = Propagation.REQUIRES_NEW,isolation = Isolation.SERIALIZABLE)
@Service("TeacherService1")
public class TeacherServiceImpl1 implements TeacherService1 {
    @Autowired
    TeacherMapper1 teacherMapper1;

    @Override
    public TeacherEntity get(long id) {
        return teacherMapper1.selectByPrimaryKey(id);
    }

    @Override
    public void update(HashMap<String, String> queryMap) {
        teacherMapper1.updateById(queryMap);
    }

    @Override
    public List<TeacherEntity> getAll() {
        return teacherMapper1.getAll();
    }


}
